/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86156
 * Date: 2023-04-07
 * Time: 10:05
 */

// private 权限修饰符  get set 方法

public class GirlFriends {
    private int age;
    private String name;

    // 赋值
    public void SetAge(int age) {
        if(age>=18&&age<=50){
            this.age = age;
        }else{
            System.out.println("非法数据");
        }
    }

    // 获取
    public int GetAge(){
        return age;
    }

    public void setName(String name){
        this.name = name;
    }

    public String getName(){
        return name;
    }
}

